package com.gxa.personal.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.gxa.common.base.RespResult;
import com.gxa.personal.entity.UserInformation;
import com.gxa.personal.mapper.UserInformationMapper;
import com.gxa.personal.service.UserInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Create with IntelliJ IDEA.
 * Description:
 * User: ZY
 * Date: 2023-04-10
 * Time: 18:56
 */
@Service
public class UserInformationServiceImpl implements UserInformationService {

    @Autowired
    UserInformationMapper userInformationMapper;

    @Override
    public RespResult modify(UserInformation userInformation) {
        int update = userInformationMapper.updateById(userInformation);
        if(update>0){
            return RespResult.success();
        }
        return RespResult.error("修改信息失败");
    }

    @Override
    public RespResult findOne(Integer userInformationId) {

        return RespResult.success(userInformationMapper.selectById(userInformationId));
    }



    @Override
    public RespResult updatePhone(UserInformation userInformation) {
        int update = userInformationMapper.updateById(userInformation);

        if(update>0){
            return RespResult.success();
        }
        return RespResult.error("修改信息失败");
    }

}
